#ifndef __DATA_H__
#define __DATA_H__

#include "main.h"

/* EEPROM ADDR PATAMETERS ******************************/

/* Parameters 数据全部占用2字节*/
#define FLASH_ADDR_INIT_FLAG    0
#define FLASH_ADDR_CH_REV_1     2
#define FLASH_ADDR_CH_REV_2     4
#define FLASH_ADDR_CH_REV_3     6
#define FLASH_ADDR_CH_REV_4     8
#define FLASH_ADDR_CH_REV_5     10
#define FLASH_ADDR_CH_REV_6     12
#define FLASH_ADDR_CH_REV_7     14
#define FLASH_ADDR_CH_REV_8     16

#define FLASH_ADDR_CH_OFFSET_1  18
#define FLASH_ADDR_CH_OFFSET_2  20
#define FLASH_ADDR_CH_OFFSET_3  22
#define FLASH_ADDR_CH_OFFSET_4  24
#define FLASH_ADDR_CH_OFFSET_5  26
#define FLASH_ADDR_CH_OFFSET_6  28
#define FLASH_ADDR_CH_OFFSET_7  30
#define FLASH_ADDR_CH_OFFSET_8  32

#define FLASH_ADDR_CH_END_POINT_P1  34
#define FLASH_ADDR_CH_END_POINT_N1  36
#define FLASH_ADDR_CH_END_POINT_P2  38
#define FLASH_ADDR_CH_END_POINT_N2  40
#define FLASH_ADDR_CH_END_POINT_P3  42
#define FLASH_ADDR_CH_END_POINT_N3  44
#define FLASH_ADDR_CH_END_POINT_P4  46
#define FLASH_ADDR_CH_END_POINT_N4  48
#define FLASH_ADDR_CH_END_POINT_P5  50
#define FLASH_ADDR_CH_END_POINT_N5  52
#define FLASH_ADDR_CH_END_POINT_P6  54
#define FLASH_ADDR_CH_END_POINT_N6  56
#define FLASH_ADDR_CH_END_POINT_P7  58
#define FLASH_ADDR_CH_END_POINT_N7  60
#define FLASH_ADDR_CH_END_POINT_P8  62
#define FLASH_ADDR_CH_END_POINT_N8  64

/* data */
 
extern uint16_t g_ch_rev[8];//通道反向标志
extern int16_t g_ch_offset[8];   //通道中心点偏移值
extern uint16_t g_ch_end_point_p[8]; //通道最大值
extern uint16_t g_ch_end_point_n[8]; //通道最小值
void parameter_set(uint16_t addr, uint16_t value);
uint16_t parameter_get(uint16_t addr);
void parameter_load(uint8_t init_flag);

#endif



